//
//  ZBKitViewController.m
//  ZBCategories
//
//  Created by lzb on 2018/10/30.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "ZBKitViewController.h"
#import "UIButton+ZBBadge.h"
#import "UIButton+ZBImagePosition.h"
#import "UIButton+ZBIndicator.h"

#import "UIAlertController+ZBBlocks.h"

#import "UIView+ZBGestureBlocks.h"

@interface ZBKitViewController ()

@property (nonatomic, strong) UIButton *bageButton;
@property (nonatomic, strong) UIButton *nomalButton;
@end

@implementation ZBKitViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createBadgeButton];
    

    
    
}

#pragma mark - UI
- (void)createBadgeButton
{
    self.bageButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.bageButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [self.bageButton setTitle:@"消息" forState:UIControlStateNormal];
    self.bageButton.backgroundColor = [UIColor yellowColor];
    [self.view addSubview: self.bageButton];
    self.bageButton.frame = CGRectMake(100, 100, 60, 40);
    [self.bageButton addNumberBadge];
    self.bageButton.zb_badgeValue = 22;
    
    self.bageButton.zb_LabelOffset = UIOffsetMake(60 - self.bageButton.fetchBadgeLabelSize.width, 0);
}


- (void)createNormalButton
{
    self.nomalButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.nomalButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [self.nomalButton setTitle:@"图文" forState:UIControlStateNormal];
    [self.nomalButton setImage:[UIImage imageNamed:@"defaule_xuanzhe"] forState:UIControlStateNormal];
    self.nomalButton.backgroundColor = [UIColor yellowColor];
    [self.view addSubview: self.nomalButton];
    self.nomalButton.frame = CGRectMake(100, 100, 80, 60);
    [self.nomalButton adjustImagePosition:ZBImagePositionBottom spacing:0];
    
}


- (void)showAlert
{
    UIAlertController *alert =[UIAlertController alertCallBackBlock:^(NSInteger buttonIndex) {
        NSLog(@"------%ld",buttonIndex);
    } title:@"温馨提示" message:@"提示内容" style:UIAlertControllerStyleActionSheet cancelButtonName:@"取消" otherButtonTitles:@"第一个",@"第二个",@"第三个", nil];
    
    [self presentViewController:alert animated:YES completion:nil];
}

@end
